package com.lwlean.test.twilio;

/**
 * Created by lean on 2017/7/17.
 */

import com.twilio.Twilio;
import com.twilio.http.HttpMethod;
import com.twilio.rest.api.v2010.account.Call;
import com.twilio.type.PhoneNumber;

import java.net.URI;
import java.net.URISyntaxException;

public class MakeCall {

    public static final String ACCOUNT_SID = "AC0a6b1015e1e9f637724918478339ac29";
    public static final String AUTH_TOKEN = "your_auth_token";

    public static void main(String[] args) throws URISyntaxException {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

        Call call = Call.creator(new PhoneNumber("+14155551212"), new PhoneNumber("+15017250604"),
                new URI("http://demo.twilio.com/docs/voice.xml")).setFallbackMethod(HttpMethod.POST).setFallbackUrl("http://lilongwei2.kiigee.com/test/testRestUrl")
                .create();

        System.out.println(call.getSid());
    }

}
